import 'package:flutter/material.dart';
import 'package:flutter_mode/zjw/data_transfer/ReduxTopScreen.dart';
import 'package:flutter_mode/zjw/data_transfer/ReduxUtil.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/redux.dart';

class ReduxWidget extends StatelessWidget {
  //第五步：创建store，放入顶层[最好放在main()顶层]
  final store =
      Store<CountState>(reducer, initialState: CountState.initState());

  @override
  Widget build(BuildContext context) {
    return StoreProvider<CountState>(
      store: store,
      child: new MaterialApp(
        title: 'Redux传递数据',
        theme: new ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: ReduxTopScreen(),
      ),
    );
  }
}
